home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / tcoop10a.zip / DOC.ZIP / SOUND.DOC < prev    next >
Text File  |  1991-11-20  |  3KB  |  87 lines

  1. SOUND.DOC       11/15/91        Copyright (c) 1991 by James S. Clark
  2. ==========================================================================
  3. SOUND
  4. Sound Class
  5. --------------------------------------------------------------------------
  6. Class Name                      Sound
  7. Superclass                      <none>
  8. Category                        Sound
  9. Other classes referenced        <none>
  10. Other catagories referenced     <none>
  11. Used by                         Play, Effect
  12. Inherited by                    Play
  13.  
  14. Declaration                     Sound   *soundsys
  15.  
  16. Instance Variables
  17.                                 <none>
  18. Instance Methods
  19.                                 Sound();
  20.                                 ~Sound();
  21.                                 void    close   ();
  22.                                 int     flush   ();
  23.                                 void    init    ();
  24.                                 int     inplay  ();
  25.                                 void    noise   (int , int );
  26.                                 void    noiseoff();
  27.                                 int     submit  (int , int );
  28. --------------------------------------------------------------------------
  29. GENERAL DESCRIPTION
  30.  
  31. The Sound Class provides a means for creating background sound effects
  32. and music.  The Sound Class hooks into the system clock interrupt and
  33. does not interfere with foreground program operation.  Tones are submitted
  34. to the sound buffer directly, or by using the Play or Effect Class to
  35. create the tones.
  36.  
  37. NOTE: Sound Class will alter the system clock.  Only ONE instance of the
  38. Sound Class should be in memory at any given time.
  39.  
  40. --------------------------------------------------------------------------
  41. VARIABLES
  42.  
  43. <none>
  44.  
  45. --------------------------------------------------------------------------
  46. METHODS
  47.  
  48. Sound();
  49.         Creates and initializes a new instance of the Sound Class;
  50.  
  51. ~Sound();
  52.         Automatically Closes and destroys an instance of the Sound Class.
  53.  
  54. void    close   ();
  55.         Closes down the sound system.  Called by ~Sound().
  56.  
  57. int     flush   ();
  58.         Flushes out any remaining tones in the sound buffer.
  59.  
  60. void    init    ();
  61.         Initializes the Sound Class.  Called by Sound().
  62.  
  63. int     inplay  ();
  64.         Returns with 1 if tones remain in the buffer.  Returns with 0 if
  65.         the buffer is empty.
  66.  
  67. void    noise   (int freq, int range);
  68.         Turns-on the background noise.  Freq controls the center frequency
  69.         of the noise.  Range controls the range of frequency variation.
  70.         The noise will be generated when no other tones are playing.
  71.  
  72. void    noiseoff();
  73.         Turns-off the background noise.
  74.  
  75. int     submit  (int freq , int dur);
  76.         Submits a new tone to the sound buffer.  The freq parameter
  77.         controls the frequency of the tone.  The dur is the duration of
  78.         the sound expressed in milliseconds (1/1000th of a second).
  79.         TECH NOTE: The default for the sound routine is approx. 128
  80.         interrupts per second.  Tones with a duration between 1 and 8
  81.         will be too short to be accurately reproduced at the default
  82.         rate.  Change the interrupt rate if you need the added precision.
  83.  
  84. --------------------------------------------------------------------------
  85. SOUND.DOC                       Copyright (c) 1991 by James S. Clark
  86. ==========================================================================
  87.